import { createRouter, createWebHistory } from 'vue-router';
import Article from './views/article/index.vue'; // 假设a.vue在views文件夹下，根据实际调整路径
import Layout from './views/Layout/index.vue';
import login from './views/login/login.vue';
import write from './views/article/write.vue';
import regist from './views/login/rigist.vue';
import change from './views/login/change.vue';
import my from './views/My/index.vue';

const routes = [
    {
        path: '/',
        component: Layout,
    },
    {
        path: '/article/:articleId', // 使用 :articleId 定义路由参数
        name: 'Article',
        component: Article,
    },
    {
        path: '/login',
        component: login,
    },
    {
        path: '/regist',
        component: regist,
    },
    {
        path: '/write',
        component: write,
    },
    {
        path: '/change',
        component: change,
    },
    {
        path: '/my',
        component: my,
    }
];

const router = createRouter({
    history: createWebHistory(),
    routes
});

export default router;